﻿<%@ Page Title="Admin Console - Edit Person" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="EditPerson.aspx.cs" Inherits="AdminConsole.EditPerson" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

    <form runat="server">
    <div id="page-content-wrapper">
        <div class="container-fluid">
            <div class="row">
                <div class="col-lg-12">
                    <h1 id="editHeader">Edit</h1>
                    <br />
                    <label>Username</label> <br />
                    <input type="text" id="username" /> <br /> <br />
                    <label>User Data</label> <br />
                    <input type="text" id="userdata" /> <br /> <br />
                    <label>Face IDs</label> <br />
                    <div style="float:left;overflow:hidden;">
                        <select id="faceIdList" size="16"></select>
                        <br />
                        <button type="button" class="btn btn-warning" onclick="deleteFaceId('<%=userId %>');">Delete Face ID</button> <br /> <br />
                        <button type="button" class="btn btn-primary btn-lg" style="margin-top:30px;" onclick="updatePerson('<%=userId %>')">Update Person</button>
                    </div>
                    <div style="float:left;overflow:hidden;margin-left:8px;height:300px;">
                        <label>New Face ID</label> <br />
                        <input type="text" id="faceId" /> <br />
                        <label>Image User Data</label> <br />
                        <input type="text" id="picdata" /> <br />
                        <label>Obtain Face ID from Image</label> <br />
                        <input type="file" id="faceIdFile" name="faceIdFile" onchange="loadImageFile();" /> <br />
                        or <br />
                        <label>Obtain Face ID from Image URL</label> <br />
                        <input type="text" id="faceUrl" /> <br /> <br />
                        <button type="button" class="btn-sm btn-primary" onclick="startFaceAdd('<%=userId %>');">Add Face ID</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <a id="redirect" href="Default.aspx"></a>

    </form>

    <script type="text/javascript">

        function startFaceAdd(userId) {
            var faceId = document.getElementById('faceId').value
            var faceUrl = document.getElementById('faceUrl').value;
            if (faceId != "") {
                addFileFaceId(userId);
            }
            else {
                addUrlFaceId(userId);
            }
        }
    </script>

</asp:Content>
